<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <div id="test">hello world</div>
    <script>
        var test =document.getElementById("test");
        /* 事件
            onclick 点击事件
            onmouseover 鼠标触碰事件
            onmouseout  鼠标移去
        
        */
        test.onclick=function(){
            // this.在事件中指向正在执行事件的当前对象
            this.style.color="red"
            // innerHTML
            this.innerHTML="change"
        }
        test.onmouseover=function(){
            this.style.backgroundColor="#121212";
        }
        test.onmouseout=function(){
            this.style.backgroundColor="#fff";
        }
    </script>    
</body>
</html>